﻿using DevExpress.ExpressApp.Blazor.Editors;
using DevExpress.ExpressApp.Blazor.Editors.Adapters;
using DevExpress.ExpressApp.Model;

namespace EasyXaf.EntityDesigner.Editors.CodeEditors;

public class CodeEditor : BlazorPropertyEditorBase
{
    public CodeEditor(Type objectType, IModelMemberViewItem model)
        : base(objectType, model)
    {
    }

    protected override IComponentAdapter CreateComponentAdapter()
    {
        return new CodeEditorAdapter(new CodeEditorModel
        {
            RowCount = Model.RowCount,
            Language = ((IModelCodeEditor)Model).CodeLanguage,
        });
    }
}
